<template>
	<!-- 修改登陆密码 -->
	<view class="bigbox">
		<u-form :model="form" ref="uForm">
			<u-form-item>
				<image src="/static/img/my/7root-tell.png" class="w20 h30 mr24"></image>
				<u-input v-model="form.password" placeholder="请输入旧密码" :placeholder-style='placeholderStyle' type="password"></u-input>
			</u-form-item>
			<!-- <u-form-item>
				<image src="/static/img/my/7设置-验证.png" class="w20 h26 mr24"></image>
				<u-input v-model="form.name" placeholder="请输入验证码" :placeholder-style='placeholderStyle'></u-input>
				<text>获取验证码</text>
			</u-form-item> -->
			<u-form-item>
				<image src="/static/img/my/7root-pw.png" class="w20 h26 mr24"></image>
				<u-input v-model="form.newpassword" placeholder="请输入新密码" :placeholder-style='placeholderStyle' type="password"></u-input>
			</u-form-item>
			<u-form-item>
				<image src="/static/img/my/7root-pw.png" class="w20 h26 mr24"></image>
				<u-input v-model="form.newpassword_re" placeholder="请输入确认密码" :placeholder-style='placeholderStyle' type="password"></u-input>
			</u-form-item>
		</u-form>
		<view class="mr56 h86 paybtn" @tap="submit()">
			确认
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					password:'',
					newpassword:'',
					newpassword_re:''
				},
				placeholderStyle:{
					fontSize: '28rpx',
					fontFamily: 'PingFang SC',
					fontWeight: '500'
				}
			};
		},
		
		methods:{
			submit(){
				this.$api.updatepwd(this.form).then(res => {
					this.$msg(res.msg);
					if(res.code == 1){
						setTimeout(()=>{
							uni.navigateBack();
						}, 1000)
					}
				})
			},
		}
	}
</script>

<style lang="scss">
page {
	background-color: #FFFFFF;
}
.bigbox {
	text {
		font-size: 22rpx;
		font-weight: 500;
		color: #FD1D4D;
	}
}
.paybtn {
		width: 80%;
		position: fixed;
		left: 50%;
		bottom: 40rpx;
		transform: translateX(-50%);
		text-align: center;
		line-height: 86rpx;
		background: #1385FF;
		border-radius: 10rpx;
		color: #FFFFFF;
		z-index: 99;
	}
</style>
